import express from "express";
// @ts-ignore
import cors from "cors";
import systemRouter from "./routers";

const app = express();
const port = 8080;

app.use(express.json());
app.use(cors());
app.use("/", systemRouter);

app.get("/", (req, res) => {
  res.send("Hello World!");
});

// 404处理
app.use((req, res) => {
  res.status(404).send("页面未找到");
});

app.listen(port, () => {
  console.log(`Server is running on http://localhost:${port}`);
});
